/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "status_parcela")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusParcela.findAll", query = "SELECT s FROM StatusParcela s")})
public class StatusParcela implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(nullable = false, length = 2)
    private String situacao;
    @Column(length = 30)
    private String descricao;
    @Lob
    @Column(length = 65535)
    private String procedimento;
    @JoinColumn(name = "ID_EMPRESA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Empresa idEmpresa;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idStatusParcelaPagar")
    private List<ParcelaPagar> parcelaPagarList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idStatusParcela")
    private List<ParcelaReceber> parcelaReceberList;

    public StatusParcela() {
    }

    public StatusParcela(Integer id) {
        this.id = id;
    }

    public StatusParcela(Integer id, String situacao) {
        this.id = id;
        this.situacao = situacao;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSituacao() {
        return situacao;
    }

    public void setSituacao(String situacao) {
        this.situacao = situacao;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getProcedimento() {
        return procedimento;
    }

    public void setProcedimento(String procedimento) {
        this.procedimento = procedimento;
    }

    public Empresa getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(Empresa idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    @XmlTransient
    public List<ParcelaPagar> getParcelaPagarList() {
        return parcelaPagarList;
    }

    public void setParcelaPagarList(List<ParcelaPagar> parcelaPagarList) {
        this.parcelaPagarList = parcelaPagarList;
    }

    @XmlTransient
    public List<ParcelaReceber> getParcelaReceberList() {
        return parcelaReceberList;
    }

    public void setParcelaReceberList(List<ParcelaReceber> parcelaReceberList) {
        this.parcelaReceberList = parcelaReceberList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusParcela)) {
            return false;
        }
        StatusParcela other = (StatusParcela) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.StatusParcela[ id=" + id + " ]";
    }
    
}
